#!/bin/bash

if [ "$#" -ne "1" ];then
    echo "useage: scripts.sh version_num"
    exit 127
fi

package_version=$1
package_type=`uname -a|awk '{print$NF}'|awk -F'_' '{printf"SynoOnlinePack_v2-"$2}'`

package_name="${package_type}-${package_version}.spk"
rm -f  ${package_name};
curl -k  https://global.synologydownload.com/download/Package/spk/SynoOnlinePack_v2/${package_version}/${package_name} --output  /tmp/${package_name};
synopkg install /tmp/${package_name};


##bash
##bash <(curl https://gitee.com/team_space/mynet_info/raw/master/SynoOnlinePack_v2-install.sh ) 762